<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>智数-登录</title>

    <link href="/web/res/css/style.css" rel="stylesheet">
    <link href="/web/res/css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="/web/res/js/html5shiv.js"></script>
    <script src="/web/res/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin"  onSubmit="return false;">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">登录</h1>
            <img src="/web/res/images/logo-black.png" width=240 height=100 alt=""/>
        </div>
        <div class="login-wrap">
            <input type="text" id="login_user_name" class="form-control" placeholder="手机号/邮箱" autofocus>
            <input type="password" id="login_password" class="form-control" placeholder="密码">
			
            <button id="login_btn" class="btn btn-lg btn-login btn-block" >
                <i class="fa fa-check"></i>
            </button>

            <div class="registration">
              	 还没有账号？
                <a class="" href="registration.html">
                    	注册
                </a>
            </div>
            <label class="checkbox">
                <input type="checkbox" value="remember-me"> 记住我
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> 忘记密码?</a>

                </span>
            </label>

        </div>

        <!-- Modal -->
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Forgot Password ?</h4>
                    </div>
                    <div class="modal-body">
                        <p>Enter your e-mail address below to reset your password.</p>
                        <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

                    </div>
                    <div class="modal-footer">
                        <button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
                        <button  class="btn btn-primary" type="button">Submit</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- modal -->

    </form>

</div>



<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="/web/res/js/jquery-1.10.2.min.js"></script>
<script src="/web/res/js/bootstrap.min.js"></script>
<script src="/web/res/js/modernizr.min.js"></script>
<script src='/assets/js/js.cookie.js'></script>
<script src='/assets/js/uuid.js'></script>

<script>
$(function(){
	
	$('#login_btn').on('click', function() {
		var username = $("#login_user_name").val();
		var password = $("#login_password").val();
		
		
		if(username==''||username==null||username==undefined){
			alert("手机号或者邮箱")
			return false;
		}
		if(password==''||password==null||password==undefined){
			alert("请输入密码")
			return false;
		}
		
		$.post("/action/user/u/login", {
			"username" : username,
			"password" : password,
			
		}, function(data) {
			if (data.code == 200) {
	
				//$("#loginLi").html("<a  href='javascript:void(0);' class='dropdown-toggle' data-toggle='dropdown'  style='font-size:16px;'>"+data.data.user_name+"</a><ul class='dropdown-menu' style='margin-top:-1px;'> <li><a href='#'><i class='fa fa-user'></i>  退出</a></li>  </ul>");
				window.location.href="/";
			} else {
				alert(data.msg);
			}
		});
	});
	

}) 

</script>
</body>
</html>
